﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:NetworkPower.UI" xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="NetworkPower.UI.ComparePort"
        Title="线路匹配" Height="568" Width="1118.358" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Window.Resources>
        <local:LoopLineBackColorConverter x:Key="llColorCvrt"/>
    </Window.Resources>
    <Grid Margin="0,0,2,30">
        <Button Content="开始匹配" HorizontalAlignment="Left" Margin="521,183,0,0" VerticalAlignment="Top" Width="75" Height="36" x:Name="Match" Click="Match_Click"   />
        <Label Content="工程名称" HorizontalAlignment="Left" Margin="26,26,0,0" VerticalAlignment="Top" Width="61"/>
        <ListView HorizontalAlignment="Left" Height="130" Margin="26,76,0,0" VerticalAlignment="Top" Width="135" Name="voltageLevelLeft" SelectionChanged="voltageLevelLeft_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn  Header="电压等级" Width="135" DisplayMemberBinding="{Binding VoltageValue}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <ListView HorizontalAlignment="Left" Height="138" Margin="26,211,0,0" VerticalAlignment="Top" Width="135" Name="SeperatorNameLeft" SelectionChanged="SeperatorNameLeft_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="间隔类型" Width="135" DisplayMemberBinding="{Binding SeperatorValue}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <ListView HorizontalAlignment="Left" Height="138" VerticalAlignment="Top" Width="135" Name="EquipNameLeft" Margin="26,361,0,0" SelectionChanged="EquipNameLeft_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="设备名称" Width="135" DisplayMemberBinding="{Binding EquipmentName}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <ListView HorizontalAlignment="Left" Height="130" Margin="962,76,0,0" VerticalAlignment="Top" Width="129" Name="voltageLevelRight" SelectionChanged="voltageLevelRight_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="电压等级" Width="135"  DisplayMemberBinding="{Binding VoltageValue}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <ListView HorizontalAlignment="Left" Height="138" Margin="962,211,0,0" VerticalAlignment="Top" Width="129" Name="SeperatorNameRight" SelectionChanged="SeperatorNameRight_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="间隔类型" Width="135"  DisplayMemberBinding="{Binding SeperatorValue}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <Button Content="导出报表" HorizontalAlignment="Left" Margin="521,224,0,0" VerticalAlignment="Top" Width="75" Height="36" Name="CreateSerialNumber" Click="CreateSerialNumber_Click"/>

        <DataGrid x:Name="dataGridViewLeft" Margin="179,74,612,10" AutoGenerateColumns="False" CanUserAddRows="false" ItemsSource="{Binding LoopLine}"  IsReadOnly="True" >
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Description}" Header="说明">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Setter Property="Background" Value="{Binding DescriptionColor}"/>
                            <Setter Property="Foreground" Value="Black"/>
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding InnerWire}" Header="内部配线">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding TerminalNo}" Header="端子号">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Setter Property="Background" Value="{Binding TerminalNoColor}"/>
                            <Setter Property="Foreground" Value="Black"/>
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding OuterWire}" Header="外部配线">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding CircuitNo}" Header="回路编号">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Setter Property="Background" Value="{Binding Converter={StaticResource llColorCvrt}}"/>
                            <Setter Property="Foreground" Value="Black"/>
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <!--<DataGridTextColumn Binding="{Binding null}" Header="分组">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}"/>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>-->
            </DataGrid.Columns>
        </DataGrid>
        <DataGrid x:Name="dataGridViewRight" Margin="615,74,177,10" AutoGenerateColumns="False" CanUserAddRows="false" ItemsSource="{Binding LoopLine}"  IsReadOnly="True">
            <!--<DataGrid.RowStyle>
                <Style TargetType="{x:Type DataGridRow}">
                    <Style.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Background" Value="Blue"/>
                            <Setter Property="Foreground" Value="White"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </DataGrid.RowStyle>
            <DataGrid.CellStyle >
                <Style TargetType="{x:Type DataGridCell}">
                    <Style.Triggers >
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Background" Value="Blue"/>
                            <Setter Property="Foreground" Value="White"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </DataGrid.CellStyle>-->
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Description}" Header="说明">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Setter Property="Background" Value="{Binding DescriptionColor}"/>
                            <Setter Property="Foreground" Value="Black"/>
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding InnerWire}" Header="内部配线">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding TerminalNo}" Header="端子号">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Setter Property="Background"  Value="{Binding TerminalNoColor}"/>
                            <Setter Property="Foreground" Value="Black"/>
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding OuterWire}" Header="外部配线">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <DataGridTextColumn Binding="{Binding CircuitNo}" Header="回路编号">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}">
                            <Setter Property="Background" Value="{Binding Converter={StaticResource llColorCvrt}}"/>
                            <Setter Property="Foreground" Value="Black"/>
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="Blue"/>
                                    <Setter Property="Foreground" Value="White"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>
                <!--<DataGridTextColumn Binding="{Binding null}" Header="分组">
                    <DataGridTextColumn.CellStyle>
                        <Style TargetType="{x:Type DataGridCell}"/>
                    </DataGridTextColumn.CellStyle>
                </DataGridTextColumn>-->
            </DataGrid.Columns>
        </DataGrid>
        <Button Content="电缆型号" HorizontalAlignment="Left" Margin="521,265,0,0" VerticalAlignment="Top" Width="75" Height="36" Name="CableType" Click="CableType_Click" />
        <ListView HorizontalAlignment="Left" Height="138" Margin="962,361,0,0" VerticalAlignment="Top" Width="129" Name="EquipNameRight" SelectionChanged="EquipNameRight_SelectionChanged">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="设备名称" Width="135" DisplayMemberBinding="{Binding EquipmentName}"/>
                </GridView>
            </ListView.View>
        </ListView>
        <TextBox x:Name="txtProjectName" HorizontalAlignment="Left" Height="23" Margin="92,28,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" IsEnabled="False" Width="392" IsReadOnly="True"/>
        <Button Content="绘图" HorizontalAlignment="Left" Margin="521,306,0,0" VerticalAlignment="Top" Width="75" Height="36" Name="btnReplace" Click="btnReplace_Click"/>
        <Button x:Name="btnClear" Content="匹配重置" HorizontalAlignment="Left" Margin="521,347,0,0" VerticalAlignment="Top" Width="75" Height="36" Click="btnClear_Click"  />

    </Grid>
</Window>
